package com.jhs.kjs.service.impl;

import java.util.List;
import java.util.Map;

import com.jhs.kjs.dto.CustomerUserDTO;
import com.jhs.kjs.service.IDashBoardService;
import com.jhs.kjs.service.dao.IDashBoardMapper;

public class DashBoardServiceImpl implements IDashBoardService{

	private IDashBoardMapper mapper;

	public void setMapper(IDashBoardMapper mapper) {
		this.mapper = mapper;
	}

	@Override
	public void test() {
		this.mapper.test();
	}

	@Override
	public void agree(CustomerUserDTO user) throws Exception {
		if(user == null) throw new Exception();
		this.mapper.agree(user);
	}

	/**
	 * 전체회사차량
	 * 큐로 관리자는 customerCode에 상관없이 다 나온다.
	 * @param user
	 * @return
	 * @throws Exception
	 */
	@Override
	public int getTotalCar(CustomerUserDTO user) throws Exception {
		return this.mapper.getTotalCar(user);
	}

	/**
	 * 현재운행차량
	 * 큐로 관리자는 customerCode에 상관없이 다 나온다.
	 * @param user
	 * @return
	 * @throws Exception
	 */
	@Override
	public int getNowRunCar(CustomerUserDTO user) throws Exception {
		return this.mapper.getNowRunCar(user);
	}

	/**
	 * 금일운행거리
	 * 큐로 관리자는 customerCode에 상관없이 다 나온다.
	 * @param user
	 * @return
	 * @throws Exception
	 */
	@Override
	public int getTodayDistance(CustomerUserDTO user) throws Exception {
		return this.mapper.getTodayDistance(user);
	}

	@Override
	public List<Long> getCarCodes(CustomerUserDTO user) throws Exception {
		return this.mapper.getCarCodes(user);
	}

	@Override
	public List<Long> getDailyTime(Map<String, Object> param) throws Exception {
		return this.mapper.getDailyTime(param);
	}

	@Override
	public Long getCheckAreaEnterCnt(Map<String, Object> param)
			throws Exception {
		return this.mapper.getCheckAreaEnterCnt(param);
	}
	
}
